﻿@{
    ViewBag.Title = "取件信息";
}
@using ZBJF.Warranty.BLL
@using ZBJF.Warranty.Common.Enums.InsuranceWarranty
@using ZBJF.Warranty.WebProvider
@using EnumHelper = ZBJF.Warranty.Common.Common.EnumHelper
@model ZBJF.Warranty.Model.InsuranceWarrantyRecord
@using (Html.BeginForm("SaveIWRPickUp", "InsuranceWarrantyRecord", FormMethod.Post, new { id = "mvcForm", name = "mvcForm", @class = "form-horizontal", enctype = "multipart/form-data" }))
{
    @Html.AntiForgeryToken()
    @Html.HiddenFor(c => c.ID)
    @Html.HiddenFor(c => c.InsuranceOrderId)
    <h4>取件信息</h4>
    if (ViewBag.ParentStatus != (byte)InsuranceWarrantyStatus.Processed && Model.Status != (byte)InsuranceWarrantyStatus.RetrurnVisited)
    {
        <table class="table table-responsive table-bordered table-hover">
            <tr>
                <th class="w120">快递公司：</th>
                <td>
                    @Html.DropDownListFor(m => m.SendExpress, ConvertToSelector.Instance.EnumTypeConvertToSelectList(typeof(ExpressEnums), addEmptySelect: false), new { validate = "{required:true,messages:{required:'快递公司必填！'}}", @class = "w-p95" })
            </td>
        </tr>
        <tr>
            <th class="w120">快递单号：</th>
            <td>@Html.TextBoxFor(m => m.SendExpressNo, new { validate = "{required:true,messages:{required:'快递单号必填！'}}", @class = "w-p95" })</td>
        </tr>
        <tr>
            <th>寄件人：</th>
            <td>@Html.TextBoxFor(m => m.SendUserName, new { validate = "{required:true,messages:{required:'寄件人必填！'}}", @class = "w-p95" })</td>
        </tr>
        <tr>
            <th>寄件人联系方式：</th>
            <td>@Html.TextBoxFor(m => m.SendUserPhone, new { validate = "{required:true,isTel:true,messages:{required:'寄件人联系方式必填！'}}", @class = "w-p95" })</td>
        </tr>
        <tr>
            <th>寄件地址：</th>
            <td>@Html.TextBoxFor(m => m.SendUserAddress, new { validate = "{required:true,messages:{required:'寄件地址必填！'}}", @class = "w-p95" })</td>
        </tr>
        <tr>
            <th>签收人：</th>
            <td>@Html.TextBoxFor(m => m.SendSignUserName, new { validate = "{required:true,messages:{required:'签收人必填！'}}", @class = "w-p95" })</td>
        </tr>
        <tr>
            <th>取件日期：</th>
            <td>
                @Html.TextBoxFor(m => m.SendExpressPickUpTime, new { Value = !Model.SendExpressPickUpTime.HasValue ? DateTime.Now.ToString("yyyy-MM-dd") : Model.SendExpressPickUpTime.Value.ToString("yyyy-MM-dd"), validate = "{required:true,messages:{required:'取件日期必填！'}}", onclick = "WdatePicker({dateFmt:'yyyy-MM-dd'})", @class = "Wdate" })
            </td>
        </tr>
        <tr>
            <th>签收时间：</th>
            <td>
                @Html.TextBoxFor(m => m.SendSignTime, new { Value = !Model.SendSignTime.HasValue ? DateTime.Now.ToString("yyyy-MM-dd  HH:mm:ss") : Model.SendSignTime.Value.ToString("yyyy-MM-dd  HH:mm:ss"), validate = "{required:true,messages:{required:'签收时间必填！'}}", onclick = "WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})", @class = "Wdate" })
            </td>
        </tr>
    </table>
    <div class="form-actions center">
        <input id="btnAuditAndPass" class="btn btn-primary Edit-R" type="submit" value="提交">
    </div>
    }
    else
    {
        <table class="table table-responsive table-bordered table-hover">
            <tr>
                <th class="w120">快递公司：</th>
                <td>@EnumHelper.Instance.GetDescription(typeof(ExpressEnums), Model.SendExpress)</td>
            </tr>
            <tr>
                <th class="w120">快递单号：</th>
                <td>@Model.SendExpressNo</td>
            </tr>
            <tr>
                <th>寄件人：</th>
                <td>@Model.SendUserName</td>
            </tr>
            <tr>
                <th>寄件人手机：</th>
                <td>@Model.SendUserPhone</td>
            </tr>
            <tr>
                <th>寄件地址：</th>
                <td>@Model.SendUserAddress</td>
            </tr>
            <tr>
                <th>签收人：</th>
                <td>@Model.SendSignUserName</td>
            </tr>
            <tr>
                <th>签收时间：</th>
                <td>@Model.SendSignTime</td>
            </tr>
        </table>
    }
}

@section scripts
{

}
